/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AuthPenSign.Signature;

import java.util.Objects;

/**
 *
 * @author V-ray
 */
public class Point {

	public Double time;
	public Double x;
	public Double y;
	public Double pressure;

	public Point(double time, double x, double y, double pressure) {
		this.time = time;
		this.x = x;
		this.y = y;
		this.pressure = pressure;
	}

	public static Integer getSize() {
		return 3;
	}

	public Double get(Integer index) {
		switch (index) {
			case 0:
				return this.x;
			case 1:
				return this.y;
			case 2:
				return this.pressure;
			default:
				return null;
		}
	}

	public void set(Integer index, Double value) {
		switch (index) {
			case 0:
				this.x = value;
				break;
			case 1:
				this.y = value;
				break;
			case 2:
				this.pressure = value;
				break;
			default:
				break;
		}
	}

	@Override
	public boolean equals(Object obj) {
		if ((this.x == ((Point) obj).x) && (this.y == ((Point) obj).y) && (this.pressure == ((Point) obj).pressure)) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		int hash = 7;
		hash = 19 * hash + Objects.hashCode(this.x);
		hash = 19 * hash + Objects.hashCode(this.y);
		hash = 19 * hash + Objects.hashCode(this.pressure);
		return hash;
	}
}
